export class BootScene extends Phaser.Scene {
    constructor() {
        super({ key: 'BootScene' });
    }

    preload() {
        // 加载资源
        this.load.image('background', 'assets/images/background.png');
        this.load.image('card-back', 'assets/images/card-back.png');
        this.load.image('ironclad', 'assets/images/characters/ironclad.png');
        
        // 加载地图瓦片集
        this.load.image('tileset', 'assets/scene/hyptosis_tile-art-batch-1.png');
        
        // 加载卡牌图片
        this.load.image('card-attack', 'assets/images/cards/attack.png');
        this.load.image('card-defend', 'assets/images/cards/defend.png');
        this.load.image('card-power', 'assets/images/cards/power.png');
        
        // 加载敌人图片
        this.load.image('enemy', 'assets/images/enemies/slime.png');
        
        // 加载UI元素
        this.load.image('energy-icon', 'assets/images/ui/energy.png');
        this.load.image('health-icon', 'assets/images/ui/health.png');
        
        // 加载buff/debuff图标
        this.load.image('buff-strength', 'assets/images/buffs/strength.png');
        this.load.image('debuff-weak', 'assets/images/debuffs/weak.png');
        
        // 加载动画sprite表
        this.load.spritesheet('damage-numbers', 'assets/images/ui/damage-numbers.png', { frameWidth: 32, frameHeight: 32 });
        this.load.spritesheet('card-play-effect', 'assets/images/effects/card-play.png', { frameWidth: 64, frameHeight: 64 });
        
        // 加载地图数据
        this.load.tilemapTiledJSON('map', 'assets/scene/map.json');
        
        // 显示加载进度
        const loadingBar = this.add.graphics({
            fillStyle: {
                color: 0x4a8af4
            }
        });

        this.load.on('progress', (value) => {
            loadingBar.clear();
            loadingBar.fillRect(0, this.game.renderer.height / 2, 
                              this.game.renderer.width * value, 60);
        });

        this.load.on('complete', () => {
            loadingBar.destroy();
            this.scene.start('MainMenuScene');
        });
    }

    create() {
        // 可以在这里添加一些初始化逻辑
        console.log('Game is booting...');
    }
}